package com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.diudiutechnology.www.yadiudiu.yadiudiu.model.CustomerServiceCenterModel;
import com.diudiutechnology.www.yadiudiu.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/8/24.
 * 帮助中心
 */

public class HelpCenterActivity extends Activity implements View.OnClickListener {
    @Bind(R.id.retur)
    LinearLayout retur;

    @Bind(R.id.question)//问题
    TextView question;
    @Bind(R.id.content)//问题详情
            TextView content;

    Context context;
    List<CustomerServiceCenterModel> getproblem=new ArrayList<>();
    private  int number=0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_help_center);
        ButterKnife.bind(this);
        context=this;
        initView();
    }

    private void initView() {
        retur.setOnClickListener(this);
        if (getIntent()!=null){
            number=getIntent().getIntExtra("number",0);
            getproblem= (List<CustomerServiceCenterModel>) getIntent().getSerializableExtra("data");
        }
        question.setText(getproblem.get(number).getQuestion());
        content.setText("       "+getproblem.get(number).getAnswer());
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.retur:
                finish();
                break;
        }
    }
}
